﻿

    <fieldset>
        <div class="row-line">
            <h3>Password</h3>
            <label class="label col col-xs-4 col-sm-3 col-md-3 col-lg-2 lbtitle">Old password</label>
            <section class="col col col-xs-8 col-sm-4">
                <label class="input" ng-class="{'state-error': !userpasswordform.oldpassword.$pristine && userpasswordform.oldpassword.$error.required}">
                    <i class="icon-append fa fa-lock"></i>
                    <input type="password" class="form-control" placeholder="Old password" name="oldpassword" ng-model="passwordModel.oldPassword" required>
                </label>
            </section>
            <div class="clearfix"></div>
        </div>
        <div class="row-line">
            <h3></h3>
            <label class="label col col-xs-4 col-sm-3 col-md-3 col-lg-2 lbtitle">New password</label>
            <section class="col col col-xs-8 col-sm-4">
                <label class="input" ng-class="{'state-error': !userpasswordform.newpassword.$pristine && userpasswordform.newpassword.$error.required}">
                    <i class="icon-append fa fa-lock"></i>
                    <input type="password" id="newpassword" class="form-control" placeholder="New password" name="newpassword" ng-model="passwordModel.newPassword" reqruired>
                </label>
            </section>
            <div class="clearfix"></div>
            <label class="label col col-xs-4 col-sm-3 col-md-3 col-lg-2 lbtitle">Confirm new password</label>
            <section class="col col col-xs-8 col-sm-4">
                <label class="input" ng-class="{'state-error': !userpasswordform.confirmnewpassword.$pristine && (userpasswordform.confirmnewpassword.$error.required || userpasswordform.confirmnewpassword.$error.pwmatch)}">
                    <i class="icon-append fa fa-lock"></i>
                    <input type="password" class="form-control" placeholder="Confirm new password" name="confirmnewpassword" ng-model="passwordModel.confirmNewPassword" pw-check="newpassword" required>
                    <div class="note note-error" ng-show="userpasswordform.confirmnewpassword.$error.pwmatch">Confirm new password was not matched.</div>
                </label>
            </section>
            <div class="clearfix"></div>
        </div>
    </fieldset>
    <footer>
        <button class="btn btn-primary" type="submit" ng-disabled="userpasswordform.$invalid || onSubmitting">Save</button>
        <indicator class="fa-2x" style="color: #2C3742; float: right; margin: 13px 5px 0px 0px;" show="onSubmitting"></indicator>
    </footer>
    <div class="row-line" ng-show="savePasswordShowMessage">
        <div class="alert alert-danger" ng-show="!savePasswordSuccessful">
            <button class="close" data-dismiss="alert">
                ×
            </button>
            <i class="fa-fw fa fa-times"></i>
            <strong>Error!</strong> {{savePasswordMessage}}
        </div>
        <div class="alert alert-success" ng-show="savePasswordSuccessful">
            <button class="close" data-dismiss="alert">
                ×
            </button>
            <i class="fa-fw fa fa-check"></i>
            <strong>Success</strong> {{savePasswordMessage}}
        </div>
    </div>

